 <#import "macro/macro.ftl" as m>
<html>
	<head>
	    <meta charset="UTF-8">
	    <title>${(systemConfig.headMainTitle)!'后台信息管理系统'}</title>
	    <@m.script type="css" href="css/login.css" version="1.0"/>
	    <@m.script type="js" href="easyui/jquery.min.js" version="1.0"/>
	    <script type="text/javascript">
	    	$(function () {
				$("#loginForm").keydown(function(e){
					 var e = e || event,
					 keycode = e.which || e.keyCode;
					 if (keycode==13) {
						 $(".login_button").trigger("click");
						 return false;
					 }
				});
				commitForm();
			})
			
			function commitForm(){
				$("#loginForm").submit(function(e) {
					var data = $("form").serialize();
					$.ajax({
					    url:"${base}/login/dologin?"+data,
					    success:res=>{
					    	if(!res.success){
					    		alert(res.msg);
					    	}
					    	if(res.success){
					    		location.href="${base}/admin/index";
					    	}
					    }
					})
					return false;<#--阻止表单提交-->
				})
			}
	    </script>
	</head>
	<body>
		<div class="second_body">
	    	<form method="post" id="loginForm">
	        	<div class="logo"><img src="${baseStatic}/images/logoImg.png"/>${(systemConfig.headLogo)!''}</div>
	            <div class="title-zh">${(systemConfig.headMainTitle)!'后台信息管理系统'}</div>
	            <div class="title-en" style="">${(systemConfig.headSubTitle)!'Enterprise Information Manage System'}</div>
	            <div class="message" data-bind="html:message"></div>
	            <table border="0" style="width:300px;">
	            	<tr>
	                	<td style="white-space:nowrap; padding-bottom: 5px;width:55px;">用户名：</td>
	                    <td colspan="2"><input type="text" id="userName" class="login" name="userName" value="${(loginNameRemeber)!''}"/></td>
	                </tr>
	                <tr>
	                    <td class="lable" style="white-space:nowrap; letter-spacing: 0.5em; vertical-align: middle">密码：</td>
	                    <td colspan="2"><input type="password" id="password" name="password" class="login" /></td>
	                </tr>
	                <tr>
	                    <td></td>
	                    <td colspan="2"><input type="checkbox" id="remember" name="remember"/><span>系统记住我</span></td>
	                </tr>
	                <tr>
	                    <td colspan="3" style="text-align:center">
	                        <input type="submit" value="登录" class="login_button" />
	                        <input type="button" value="重置" class="reset_botton" />
	                    </td>
	                </tr>
	            </table>
	        </form>
	    </div>
    </body>
   </html>